<template>
	<view class="main" @touchstart="isShow=true"  @touchend="changeShow()">

		<view class="suspend-view-show">
			<view class="suspend-view-show-item" :class="{'anim-transX1':isShow}" @click="onlineKefu()">
				<image src="http://images.linglinggong.net/bigCustomer/online.png" mode="aspectFill"></image>在线客服
			</view>
			
			<view class="suspend-view-show-item" :class="{'anim-transX':isShow}" @click="isShowmodel()">
				<image src="http://images.linglinggong.net/bigCustomer/ph1.png" mode="aspectFill"></image>客服电话
			</view>
			
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isShow: false,
				timer: 0,
				kefu_phone: '',
				isOpenModal: false,
			}
		},
		methods: {
			call_phone() {
				uni.makePhoneCall({
					phoneNumber: this.kefu_phone
				})
			},
			isShowmodel() {
				uni.showModal({
					title: '客服电话',
					content: '是否拨打电话了解更多？',
					showCancel: true,
					confirmColor: '#4E9800',
					cancelText: '取消',
					confirmText: '拨打',
					success: res => {
						if (res.confirm) {
							this.call_phone()
						} else {}
					}
				})
			},
			changeShow() {
				clearTimeout(this.timer)
				this.timer = setTimeout(() => {
					this.isShow = false
				}, 4000)
			},
			onlineKefu(){
				uni.navigateTo({
					url:'/pages/onLinePage/kefu?userId='+uni.getStorageSync('userInfo').userId
				})
			},
		},
		onLoad() {
			this.kefu_phone = uni.getStorageSync('property_list_by_type').telephone
		},
	}
</script>

<style lang="less" scoped>
	.main {
		background-image: url(http://images.linglinggong.net/images/main/sadasdasdasdasd23.jpg);
		background-size: 100% 100%;
		width: 750rpx;
		height: 5624rpx;
	}

	.suspend-view-show {
		width: 185rpx;
		height: 140rpx;
		position: fixed;
		right: 0;
		bottom: 260rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.suspend-view-show-item {
		width: 185rpx;
		height: 60rpx;
		background-color: #0460FF;
		border-radius: 50rpx 0 0 50rpx;
		display: flex;
		align-items: center;

		&>image {
			width: 40rpx;
			height: 40rpx;
			margin: 0 10rpx;
		}

		font-size: 28rpx;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 60rpx;
	}

	.anim-transX {
		animation: 1s transX ease-out 0s 1;
		animation-fill-mode: forwards;
	}

	.anim-transX1 {
		animation: 1s transX ease-out 0.5s 1;
		animation-fill-mode: forwards;
	}

	@keyframes transX {
		100% {
			transform: translateX(120rpx);
		}
	}
	.share-modal {
		z-index: 500;
		position: fixed;
		bottom: 0;
		height: 100vh;
		width: 100vw;
		background-color: rgba(0, 0, 0, 0.40);

		&>.mains {
			position: fixed;
			bottom: 0;
			// padding: 30rpx;
			background: #FFFFFF;
			box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.05) inset;
			border-radius: 17px 17px 0 0;
	
			display: flex;
			flex-direction: column;
	
			// align-items: center;
			&>.close {
				position: absolute;
				right: 30rpx;
				top: 30rpx;
				width: 42rpx;
				height: 42rpx;
			}
	
			&>view {
				display: flex;
				width: 100vw;
				padding: 100rpx 0 80rpx;
	
				&>view {
					// border: 1px solid #000000;
					display: flex;
					flex: 1;
					flex-direction: column;
					align-items: center;
					justify-content: center;
	
					&>image {
						width: 84rpx;
						height: 84rpx;
						margin-bottom: 20rpx;
					}
				}
			}
		}
	}
</style>
